<?php
session_start();
include "includes/comunes.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sistema de Registro de Atencion</title>

<link href="estilos.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div class="container">
<?php include "includes/head.php"?>
   <div class="content">
       <div class="tituloprincipal">IMPORTANTE : ALERTAS DE DEMORA DE PEDIDOS !!!
           <div class="botonvolver">
                <a href="salir.php">Salir</a>
           </div>
           <div class="botonvolver">
                <a href="javascript:history.back(1)">Volver</a>
           </div>
            <div class="botonvolver">
                <a href="panel.php">Panel</a>
           </div>
           </div>
       <div class="contenedor">
           <form action="des_index.php">
       <table width="715px" style="border: 1px solid #ccc">
           <thead style="border: 1px solid #ccc; background-color: #ccc">
               <td class="textotablamenu" style="color: #000000">Nro. Pedido</td>
               <td class="textotablamenu" style="color: #000000">Estado</td>
               <td class="textotablamenu" style="color: #000000">Dias de Atraso</td>
           </thead>
           <?php
           $sql="select * from pedidos where pedidoActivo<>0 and pedidoEstado<> 3 and pedidoOrigen=".$_SESSION['usuSucursal']." and pedidoFechaPlanificada < '".date('Y-m-d')."'";
           
            $res=cons_sql_up($sql);

            while($reg=  mysql_fetch_array($res)):
           ?>
            <tr>
               <td class="textotablamenu" style="background-color: red;color: #000000"><?php echo $reg['pedidoID']?></td>
               <td class="textotablamenu" style="color: #000000"><?php echo obtener_nombre_estado($reg['pedidoEstado'])?></td>
               <td class="textotablamenu" style="color: #000000"><?php echo diferenciaEntreFechas(date("Y-m-d"), $reg['pedidoFechaPlanificada']) ?></td>
           </tr>
          <?php
         endwhile
          ?>
         
       </table>
        <input name="submit" id="submit" type="submit" value="Continuar" class="boton_form"/>
           </form>
       </div>
       <div class="clear"></div>
   <br>
   </div>
  <?php include "includes/pie.php"?>
  
</div>
</body>
</html>
